// 仅示例
import request from "./request";
// export const baseUrl = "http://47.115.225.31:8011";
export const baseUrl = "https://wsh.swpu.edu.cn/blow_api";

/**
 *
 * @param data
 * @returns
 */
export function Login(data) {
  return request({
    url: "http://80.149.27.78:8001/login",
    method: "post",
    data: data,
  });
}
export function getAuth(data) {
  return request({
    url: baseUrl + "/compus/user-info",
    method: "post",
    data: data,
  });
}
export function createOrder(data) {
  return request({
    url: baseUrl + "/blow/usage-records/wechat/add",
    method: "post",
    data: data,
  });
}
export function queryUserInfo(data) {
  return request({
    url: baseUrl + "/api/proxy/queryUserInfo",
    method: "get",
    params: data,
  });
}

export function payMnt(data) {
  return request({
    url: "https://service.payment.goliveplus.cn/api/proxy/queryUserInfo",
    method: "get",
    params: data,
  });
}

export function generate(data) {
  return request({
    url: baseUrl + "/payment/generate",
    method: "post",
    data: data,
  });
}
export function getList(data) {
  return request({
    url: baseUrl + "/orders/student/" + data.studentId,
    method: "get",
    params: data,
  });
}
export function validate(data) {
  return request({
    url: baseUrl + "/student-whitelist/validate",
    method: "get",
    params: data,
  });
}

//*********
//校园用户注册查询
export function compususerinfo(params) {
  return request({
    url: baseUrl + "/blow/login/authenticate",
    method: "get",
    params,
  });
}

//吹风机使用记录列表
export function endbackfindAll(params) {
  return request({
    url: baseUrl + "/blow/usage-records/wechat/findAll",
    method: "get",
    params,
  });
}

//注意事项
export function announcementsfindAll(params) {
  return request({
    url: baseUrl + "/blow/announcements/wechat/findEnabled",
    method: "get",
    params,
  });
}

//分页查询设备列表
export function devicesendback(params) {
  return request({
    url: baseUrl + "/blow/devices/end_back/findAll",
    method: "get",
    params,
  });
}

//设备详情
export function devicesfindById(params) {
  return request({
    url: baseUrl + "/blow/devices/wechat/findById",
    method: "get",
    params,
  });
}

//分页查询所有快捷时长选项
export function blowdurationsfindAll(params) {
  return request({
    url: baseUrl + "/blow/quick_durations/findAll",
    method: "get",
    params,
  });
}

//上报维修
export function repairwechatadd(params) {
  return request({
    url: baseUrl + "/blow/repair/wechat/add",
    method: "post",
    params,
  });
}

//上传图片
export function repairsimages(data) {
  return request({
    url: baseUrl + `/blow/repairs/upload`,
    method: "post",
    headers: {
      "Content-Type": "multipart/form-data", // 重要：设置正确的 Content-Type
    },
    data,
  });
}

//获取openid
export function getOPenIdByAccount(params) {
  return request({
    url: baseUrl + "/blow/proxy/getOpenId",
    method: "get",
    params,
  });
}

//获取微信调用的信息
export function tripartitewxToken(params) {
  return request({
    url: baseUrl + "/compus/wx-token",
    method: "get",
    params,
  });
}

//获取jsapi_ticket
export function ticketgetticket(data) {
  return request({
    url: baseUrl + "/compus/getTicket",
    method: "get",
    params: data,
  });
}
